﻿<Page 
    x:Class="PerspectiveDemo.Wpf3D.View.PieSliceDemo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:p="http://www.codeplex.com/perspective"
    Title="PieSlice"
    Style="{StaticResource PageStyle}">
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Wpf3DResources.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <Transform3DGroup x:Key="PieTransform">
                <RotateTransform3D>
                    <RotateTransform3D.Rotation>
                        <AxisAngleRotation3D 
                        Angle="-90"
                        Axis="1,0,0" />
                    </RotateTransform3D.Rotation>
                </RotateTransform3D>
                <ScaleTransform3D ScaleY="0.2"/>
            </Transform3DGroup>
            <!--<Transform3DGroup x:Key="SelectedPieSliceTransform">
                <StaticResource ResourceKey="PieTransform"/>
                <TranslateTransform3D OffsetY="0.1" />
            </Transform3DGroup>-->
            <MaterialGroup x:Key="GlossyRed">
                <DiffuseMaterial Brush="Red"/>
                <StaticResource ResourceKey="Specular"/>
            </MaterialGroup>
            <MaterialGroup x:Key="GlossyBlue">
                <DiffuseMaterial Brush="Blue"/>
                <StaticResource ResourceKey="Specular"/>
            </MaterialGroup>
            <MaterialGroup x:Key="GlossyGreen">
                <DiffuseMaterial Brush="Green"/>
                <StaticResource ResourceKey="Specular"/>
            </MaterialGroup>
        </ResourceDictionary>
    </Page.Resources>
    <p:Workshop3D>
        <!--<p:XyzAxis3D Length="3" />-->
        <p:PieSlice3D 
            AngleValue="45" 
            IsExploded="True"
            Material="{StaticResource GlossyMaterial}"
            Transform="{StaticResource PieTransform}"/>
        <p:PieSlice3D 
            InitialAngle="45" AngleValue="135" 
            Material="{StaticResource GlossyRed}"
            Transform="{StaticResource PieTransform}"/>
        <p:PieSlice3D 
            InitialAngle="180" AngleValue="80" 
            Material="{StaticResource GlossyBlue}"
            Transform="{StaticResource PieTransform}"/>
        <p:PieSlice3D 
            InitialAngle="260" AngleValue="100" 
            Material="{StaticResource GlossyGreen}"
            Transform="{StaticResource PieTransform}"/>
    </p:Workshop3D>
</Page>
